<link rel="stylesheet"
	href="/static/public/ztree/css/zTreeStyle/zTreeStyle.css"
	type="text/css">
<script type="text/javascript"
	src="/static/public/jquery.js"></script>
	
	
<script src="/static/public/jquery-ui.js" type="text/javascript"
	charset="utf-8"></script>


<script type="text/javascript" src="../../static/public/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="../../static/public/ueditor/ueditor.all.js"></script>
<!-- 语言包文件(建议手动加载语言包，避免在ie下，因为加载语言失败导致编辑器加载失败) -->
<script type="text/javascript" src="../../static/public/ueditor/lang/zh-cn/zh-cn.js"></script>
<script src="/static/public/evol.colorpicker.min.js"
	type="text/javascript" charset="utf-8"></script>
<link href="/static/public/css/evol.colorpicker.css" rel="stylesheet"
	type="text/css">
<link href="/static/public/css/jquery-ui.css" rel="stylesheet"
	type="text/css">
	<link href="../../static/bootstrap2/css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">

{literal}
<script type='text/javascript'>

 $(document).ready(function(){
    $('#cate').change(function(){
       var a=$(this).children('option:selected').val();  //弹出select的值
      
     //  window.location.href='/factory/data/?mid={/literal}{$module}{literal}&cid='+a;
    });
	var user=getCookie("user");
    $("input[name='author']").val(user);
    $("#mycolor").colorpicker({
        color: "#ffc000",     
        history: false,
        displayIndicator: false
        });
    $("#mycolor").on("change.color", function(event, color){
        $('#title').css('color', color);
        var x=$("#b").attr("class");
        if(x=="b"){
            $("input[name='css']").val('color:'+color+";font-weight:bold;");
        }else{
       	 $("input[name='css']").val('color:'+color);
           }
    })
   });

function checktitle(){
   var t=$("#title").val();
   $.post("/news/checktitle",{title:t},function(result){
	   if(result.status==true){
		   $("#checktitle").addClass("alert alert-success");
		   }else{
			   $("#checktitle").addClass("alert alert-error");
			   }
	
    $("#checktitle").html(result.message)
   },"json")
}


function getCookie(name){var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));if(arr != null) return decodeURIComponent(arr[2]); return null;}


			
			function apd(t){
			    var htm='<input type="text" name='+t+'[]>';
			     $("#"+t).append(htm);
			}
			function jiacu(){
				var c=$("#mycolor").val();
				if(c!="#ffc000"){
                    c="color:"+c+";";
				}else{
                    c=""; 
				}
             
               var x=$("#b").attr("class");
               if(x=="b"){
            	   $("#title").css("font-weight","");
                   $("#b").removeClass("b");
                   $("input[name='css']").val(c);
               }else{             
               $("#title").css("font-weight","bold");
               $("#b").addClass("b");
               $("input[name='css']").val(c+"font-weight:bold;");
               }
               
			}

		
		</script>
{/literal}

{include file="news/top.tpl"}


{include file="news/nav.tpl"}


<!-- start: Content -->
			<div id="content" class="span10">
			
						
			<div class="row-fluid">



			<div class="well"> <!-- Only required for left/right tabs -->
  <ul class="nav nav-tabs">
    <li class="active"><a href="#tab1" data-toggle="tab">{$lang['BASE']}</a></li>
    <li><a href="#tab2" data-toggle="tab">{$lang['EXTEND']}</a></li>
  </ul>
  <div class="tab-content">
   <div class="tab-pane active" id="tab1">
						 
<form name="news" action="/factory/add" method="post"
	enctype="multipart/form-data" class="form-inline"><!-- 内容// -->
	
<table class="table">
	
	<tr>
		<td class="span2">{$lang['TITLE']}</td>
		<td class="span8">

<input type="hidden" name="css" value="" />
<input type="text" name="title"  class="input-xxlarge rule" id="title">
			

			<div  id="checktitle"></div>

	

		</td>
		<td>
		<a href="javascript:checktitle()" 
			style="float: left; line-height: 30px; width: 70px;">[{$lang['CHECK']}]</a>
	<div id="b"
			style="height: 25px; float: left; border: 1px #ccc solid; width: 16px; height: 16px; margin-top: 1px; padding: 3px; margin-right: 10px;"><a
			href="javascript:void(0)" style="width: 20px;" onclick="jiacu()"><b>B</b></a></div>

		</td>

	</tr>
	
	
	<tr>
		<td class="span2">{$lang['SUBTITLE']}</td>
		<td class="span8">

<input type="text" name="subtitle"  class="input-xlarge" id="title">
			

			<div  id="checktitle"></div>

	

		</td>
		<td>
	
		</td>

	</tr>
	
	<tr>
		<td ></td>
		<td >
		<div class="col-md-4">
	{$category}
			</div>
			</td>
		<td  ></td>

	</tr>


	<tr>
		<td >{$lang['FLAG']}</td>
		<td >{foreach from=$flag item=l}
		
		 <input type="checkbox"
			class="checkbox" value="{$l.flag}" name="flag[]" id="{$l.flag}">{$l.name} {/foreach}
		</td>
		<td ></td>

	</tr>

	<tr>
		<td >{$lang['THUMB']}</td>
		<td >
		<div class="uploader" id="uniform-fileInput"><input class="input-file uniform_on" name="thumb" id="fileInput" type="file"><span class="filename" style="-webkit-user-select: none; ">No file selected</span><span class="action" style="-webkit-user-select: none; ">Choose File</span></div>
		
		
		 <input type="text"
			size="3" maxlength="3" name="width" class="input-mini"
			value="{if $width!=''}{$width}{else}360{/if}">x<input maxlength="3"
			type="text" size="3" name="height" class="input-mini"
			value="{if $height!=''}{$height}{else}360{/if}">OR<input
			type="checkbox" name="same">{$lang['PIC']}</td>
		<td >
	
		</td>

	</tr>